# -*- coding: utf-8 -*-
# @Time: 2021/8/16 15:31
# @File: meituan-002.py
# @DESC:

def max_weight(i):
    return 9


# n = int(input())

n = 5

w = [3, 2, 4, 4, 5]

g = [4, 3, 5, 2, 1]

for i in g:
    w[i - 1] = 0
    r = sum(w[i + 1:n])
    l = sum(w[0:i - 1])
    print(max(r, l))
